"A menu item that executes a single macro command."
if hint:
hint = hintPlusInfobaselink(hint,infobaselink)
m = item(text, macroclick, hint)
m.macro = macro
return m
def macroclick(m):
if not (quarkx.clickform is None):
quarkx.clickform.macro(m.macro) # returns True (1) or False (0) depending on success or failure
def catmenus(list1, list2):
"Concat the two lists of menu items, adding a separator if required."
if len(list1):
if len(list2):
return list1 + [sep] + list2
return list1
return list2
#
# Standard menus.
#
def DefaultFileMenu():
"The standard File menu, with its shortcuts."
#NewMap1 = item("&New map") # not implemented yet
Open1 = macroitem("&Open...", "FOPN", "|You can open a file of ANY type.", "intro.mapeditor.menu.html#filemenu")
savehint = "|You have several ways to save your maps :\n\nAs .map files : the .map format is standard among all Quake editors, but you should only use it to exchange data with another editor, because QuArK cannot store its own data in .map files (e.g. groups, duplicators, etc).\n\nAs .qkm files : this is QuArK's own file format for maps.\n\nInside .qrk files : this is the best solution if you want to organize several maps inside a single file. Choose the menu command 'Save in QuArK Explorer'."
Undo1 = macroitem("&Undo", "UNDO", "|undo the previous action (unlimited)", infobaselink)
Redo1 = macroitem("&Redo", "REDO", "|redo what you have just undone", infobaselink)
UndoRedo1 = macroitem("U&ndo / Redo...", "MURD", "|list of actions to undo/redo", infobaselink)
Cut1 = item("&Cut", editor.editcmdclick, "|cut the selection to the clipboard", infobaselink)
Cut1.cmd = "cut"
Copy1 = item("Cop&y", editor.editcmdclick, "|copy the selection to the clipboard", infobaselink)
Copy1.cmd = "copy"
Paste1 = item("&Paste", editor.editcmdclick, "|paste a map object from the clipboard", infobaselink)
Paste1.cmd = "paste"
Duplicate1 = item("Dup&licate", editor.editcmdclick, "|This makes a copy of the selected object(s). The copies are created at exactly the same position as the original, so don't be surprised if you don't see them : there are here, waiting to be moved elsewhere.", infobaselink)
Duplicate1.cmd = "dup"
Delete1 = item("&Delete", editor.editcmdclick, "|delete the selection", infobaselink)